package cn.fy.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

//@EnableDiscoveryClient //开启eureka客户端，
@SpringCloudApplication
@EnableFeignClients//开启feign组件
public class ServiceConsumerApplication {


    public static void main(String[] args) {
        SpringApplication.run(ServiceConsumerApplication.class, args);
    }


    @Bean
    @LoadBalanced//开启Ribbon的负载均衡
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
